import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '../views/login/index.vue'
import layout from "../views/layout/index.vue"


Vue.use(VueRouter)

const routes = [
    {path:"/",redirect:"/login"},
    {path:"/login",component:login}, 
    // {path:"/layout",component:layout},
    //首页
    {path:"/home",component:layout,children:[
      {path:'',component:()=>import('../views/home/index.vue')}
    ]},
    //
    {path:"/users",meta:{path:"/users",title:"用户"},component:layout,children:[
      {path:"",meta:{path:"/users",title:"用户"},component:()=>import("../views/users/users")}
    ]},
    //权限管理
    {path:"/order",meta:{path:"/order",title:"权限管理"},component:layout,children:[
      {path:"/",meta:{path:"/order",title:"权限管理"},redirect:"/order/list"},
      {path:"list",meta:{path:"/order/list",title:"权限列表"},component:()=>import("../views/order/list.vue")},
      {path:"panson",meta:{path:"/order/panson",title:"角色列表"},component:()=>import("../views/order/panson.vue")},
    ]},
    //商品列表
    {path:"/shop",meta:{path:"/shop",title:"商品管理"},component:layout,children:[
      {path:"/",meta:{path:"/shop",title:"商品管理"},redirect:"/shop/list"},
      {path:"list",meta:{path:"/shop/list",title:"商品列表"},component:()=>import("../views/shop/list.vue")},
      {path:"num",meta:{path:"/shop/num",title:"分类参数"},component:()=>import("../views/shop/num.vue")},
      {path:"type",meta:{path:"/shop/type",title:"商品分类"},component:()=>import("../views/shop/type.vue")},
      {path:"save",meta:{path:"/shop/save",title:"商品添加"},component:()=>import("../views/shop/save.vue")},
    ]},
    //订单列表
    {path:"/money",meta:{path:"/money",title:"订单管理"},component:layout,children:[
      {path:"list",meta:{path:"/money",title:"订单列表"},component:()=>import("../views/money/list.vue")}
    ]},
    //数据统计
    {path:"/eachers",meta:{path:"/eachers",title:"数据统计"},component:layout,children:[
      {path:"index",meta:{path:"/money",title:"统计实例"},component:()=>import("../views/eachers/index.vue")}
    ]}
    


]

const router = new VueRouter({

  routes
})

export default router
